package com.joysuch.wwyt.attendance.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.joysuch.wwyt.attendance.bean.AttendanceGroupShiftBean;
import com.joysuch.wwyt.attendance.bean.AttendanceGroupShiftListBean;
import com.joysuch.wwyt.attendance.bean.AttendanceShiftParam;
import com.joysuch.wwyt.attendance.dto.AttendanceShiftDto;
import com.joysuch.wwyt.attendance.entity.AttendanceGroup;
import com.joysuch.wwyt.attendance.entity.AttendanceShift;
import com.joysuch.wwyt.core.bean.SimpleListBean;
import com.joysuch.wwyt.core.common.ajax.ResultBean;
import com.joysuch.wwyt.core.exception.ApiBusinessException;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 考勤班次
 * </p>
 *
 * @author zqw
 * @since 2022-02-28
 */
public interface AttendanceShiftService extends IService<AttendanceShift> {

    /**
     * 新增/修改
     *
     * @param dto
     * @return
     */
    AttendanceShift saveShift(AttendanceShiftDto dto) throws ApiBusinessException;

    /**
     * 查看
     *
     * @param id
     * @return
     */
    AttendanceShiftDto findById(Long id);

    /**
     * 分页查看
     *
     * @param pageParam
     * @return
     */
    ResultBean pageShift(AttendanceShiftParam pageParam);

    /**
     * 删除考勤班次
     *
     * @param id
     */
    void deleteById(Long id) throws ApiBusinessException;


    List<AttendanceShift> getByIds(List<Long> shiftIds);

    /**
     * 排班修改列表
     *
     * @param groupId 考勤组id
     * @return
     */
    List<AttendanceGroupShiftListBean> getShiftsByGroupId(Long groupId);

    /**
     * 获取考情组所有考勤班次map(id:bean)
     *
     * @return
     */
    Map<Long, AttendanceGroupShiftBean> getShiftBeanMapFromGroup(AttendanceGroup group);

    /**
     * 获取考情组所有考勤班次map(name:bean)
     *
     * @return
     */
    Map<String, AttendanceShift> getShifNameMap(AttendanceGroup group);

    /**
     * 人员排班小标题
     *
     * @param groupId
     * @return
     */
    List<SimpleListBean> getTitleByGroupId(Long groupId);
}
